<html>
	<head>
<STYLE>.toolbartable
{
	background: #889CD5;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
}
.toolbartext
{
	font-size: 12px;
	font-family: Verdana,Tahoma;
	font-weight:bolder;
	color: Black;
}
.toolbarselect
{
	font-size: 11px;
	font-family: Verdana,Tahoma;
	font-weight:normal;
}
.toolbarbutton
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    BACKGROUND-COLOR: #cccccc;
    color:Black;
    border-color:Silver;
}
.toolbartitleheading
{
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
	text-align:right;
}
.toolbartitle
{
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
	text-align:right;
	font-weight:bolder;
}


.toolboxtable
{
	background:  #889CD5;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
}
.toolboxinternaltable
{
	background:  #889CD5;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
}
.toolboxheading
{
	background: black;
	font-size: 12px;
	font-family: Verdana, Tahoma;
	color: White;
	font-weight:bolder;
	text-align:center;
}
.toolboxcolumn
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    BACKGROUND-COLOR:  #889CD5;
    color:white;
    border-color:White;
    border-top: 1px ridge #C6B36C;
	border-right: 1px ridge #413400;
	border-bottom: 1px ridge #413400;
	border-left: 1px ridge #C6B36C;
}
.toolboxbuttons
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    BACKGROUND-COLOR: #889CD5;
    color:white;
    border-color:White;
}
.toolboxparent
{
	background:  #C4D2FB;
	font-size: 11px;
	font-family: Verdana, Tahoma;
	color: black;
	font-weight:bolder;
	text-align:center;
}
.toolboxparentbevell
{
	background:  #889CD5;
	font-size: 11px;
	font-family: Verdana, Tahoma;
	color: White;
	font-weight:bolder;
	text-align:center;
	border-top: 1px ridge #C6B36C;
	border-right: 1px ridge #413400;
	border-bottom: 1px ridge #413400;
	border-left: 1px ridge #C6B36C;
}


.imagetable
{
	background: #C4D2FB;
}
.imageiframe
{
	background: #FFFF66;
}



.propertiesboxtable
{
	background: #889CD5;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
}
.propertiesboxheading
{
	background: Black;
	font-size: 12px;
	font-family: Verdana, Tahoma;
	color: White;
	font-weight:bolder;
	text-align:center;
}
.propertiesboxactionselect
{
	font-size: 11px;
	font-family: Verdana,Tahoma;
	font-weight:normal;
}
.propertiesboxbuttons
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    BACKGROUND-COLOR: #cccccc;
    color:black;
    border-color:silver;
}
.propertiesboxpropertytable
{
	background: Silver;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
}
.propertiesboxpropertyextraspace
{
	background:  #C4D2FB;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
}
.propertiesboxpropertybuttonstable
{
	background:  #C4D2FB;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
}
.propertiesboxinput
{
	FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    text-decoration: none;
}
.propertiesboxselect
{
	font-size: 11px;
	font-family: Verdana,Tahoma;
	font-weight:normal;
}
.propertiesboxpropertytitle
{
	font-size: 11px;
	font-family: Verdana,Tahoma;
	font-weight:normal;
	background: #C4D2FB;
}
.propertiesboxinputs
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
	border: 0px #737373 solid;
	text-decoration: none;
}
.propertiesboxinputstable
{
	background: White;
	font-size: 11px;
	font-family: Verdana,Tahoma;
	color: Black;
}
.propertiesboxinputbutton
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    BACKGROUND-COLOR: #889CD5;
    color:White;
    border-color:White;
}
TD
{
    FONT-SIZE: 10px;
    FONT-FAMILY: Verdana,Tahoma
}
P
{
    FONT-SIZE: 10px;
    FONT-FAMILY: Verdana,Tahoma
}
A
{
    COLOR: navy
}
.linkinputs
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    text-decoration: none;
    border: 1px #737373 solid;
    width: 200px
}
.returninputs
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    text-decoration: none;
    border: 1px #737373 solid;
    width: 150px
}
.inputs
{
    FONT-SIZE: 12px;
    FONT-FAMILY: Verdana,Tahoma;
    text-decoration: none;
    border: 1px #737373 solid
}
.lockedinputs
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    BACKGROUND-COLOR: #DBEAF5;
}
.buttons
{
    FONT-SIZE: 11px;
        FONT-FAMILY: Verdana,Tahoma;
        BACKGROUND-COLOR: #cccccc;
        color:black;
    border-color:silver;
}
.pageheader
{
    FONT-WEIGHT: bold;
    FONT-SIZE: 12px;
    FONT-FAMILY: Verdana,Tahoma
}
.properties
{
    FONT-SIZE: 11px;
    COLOR: maroon;
    FONT-FAMILY: Verdana,Tahoma
}
.list
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana, Tahoma
}
.propertyselected
{
    BACKGROUND-COLOR: midnightblue
}
.propertytableinputs
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
	border: 1px solid white;
	text-decoration: none
}
.propertypage
{
	background-color : #93BEE2;
}
.controlbg
{
	background-color : #93BEE2;
}
.gridtableinputs
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
	border: 1px solid white;
}
.gridanchor
{
    FONT-SIZE: 10px;
    FONT-FAMILY: Verdana,Tahoma;
	text-decoration:none;
}</STYLE>

<script language="javascript">
var OPflag=false;
var ServiceID = "<%#ServiceID%>";

function LoadMethods(){

document.form1.sel_methods.options.length = 1;

	for(i=0;i < AssemblyInfo.XMLDocument.documentElement.childNodes.length;i++){
		document.form1.sel_methods.options[i+1] = new Option(AssemblyInfo.XMLDocument.documentElement.childNodes(i).attributes.getNamedItem("Name").value);
	}
}

function LoadLoginInfo(){
	LoginNameType	= MethodDetailsDI.XMLDocument.documentElement.attributes.getNamedItem("LoginNameType").value;
	LoginName		= MethodDetailsDI.XMLDocument.documentElement.attributes.getNamedItem("LoginName").value;

	if(LoginNameType != ""){
		for(var i=0; i < document.form1.DataType1.options.length; i++) {
			if(document.form1.DataType1.options[i].value == LoginNameType){
				document.form1.DataType1.options[i].selected = true;
				break;
			}
		}
		populateValues('1','DataType','DataList','LoginName');

		if(LoginNameType != "Value"){
			for(var i=0; i < document.form1.DataList1.options.length; i++) {
				if(document.form1.DataList1.options[i].value == LoginName){
					document.form1.DataList1.options[i].selected = true;
					break;
				}
			}
		}
		else{
			 document.form1.LoginName1.value = LoginName;
		}
	}

	Password	 = MethodDetailsDI.XMLDocument.documentElement.attributes.getNamedItem("Password").value;
	PasswordType = MethodDetailsDI.XMLDocument.documentElement.attributes.getNamedItem("PasswordType").value;
	if(PasswordType != ""){
		for(var i=0; i < document.form1.DataType2.options.length; i++) {
			if(document.form1.DataType2.options[i].value == PasswordType){
				document.form1.DataType2.options[i].selected = true;
				break;
			}
		}
		populateValues('2','DataType','DataList','Password');

		if(PasswordType != "Value"){
			for(var i=0; i < document.form1.DataList2.options.length; i++) {
				if(document.form1.DataList2.options[i].value == Password){
				document.form1.DataList2.options[i].selected = true;
				break;
				}
			}
		}
		else{
			  document.form1.Password2.value = Password;
		}
	}

	DomainName		= MethodDetailsDI.XMLDocument.documentElement.attributes.getNamedItem("DomainName").value;
	DomainNameType	= MethodDetailsDI.XMLDocument.documentElement.attributes.getNamedItem("DomainNameType").value;

	if(DomainNameType != ""){
		for(var i=0; i < document.form1.DataType3.options.length; i++) {
			if(document.form1.DataType3.options[i].value == DomainNameType){
				document.form1.DataType3.options[i].selected = true;
				break;
			}
		}
		populateValues('3','DataType','DataList','DomainName');

		if(DomainNameType != "Value"){
			for(var i=0; i < document.form1.DataList3.options.length; i++) {
				if(document.form1.DataList3.options[i].value == DomainName){
					document.form1.DataList3.options[i].selected = true;
					break;
				}
			}
		}
		else{
			document.form1.DomainName3.value = DomainName;
		}
	}
}

function LoadParameters(SelIndex){
if (SelIndex == "0")
{
	ParameterList.innerHTML   = "";
	OutputParameter.innerHTML = "";
	return;
}

  ParamLength = AssemblyInfo.XMLDocument.documentElement.childNodes(SelIndex-1).childNodes.length;

 if(SelIndex != "0" && ParamLength > 0){
	 var strHTML = "<table border=0 cellpadding=3 cellspacing=1  bgcolor=#808080>";
	 strHTML += "<tr><td bgcolor=#d4d0c8>Parameter Name</td><td bgcolor=#d4d0c8>Data Type</td><td bgcolor=#d4d0c8>&nbsp;</td><td bgcolor=#d4d0c8>&nbsp;</td></tr>";

	 var selectBox =	"<option></option><option value='Variable'>Variable</option><option value='Content'>Content</option><option value='Value'>Value</option>";

	  for(j=0;j < AssemblyInfo.XMLDocument.documentElement.childNodes(SelIndex-1).childNodes.length;j++){
 	    strHTML += "<tr>";
	    strHTML += "<td bgcolor=#ffffff>"+ AssemblyInfo.XMLDocument.documentElement.childNodes(SelIndex-1).childNodes(j).text + "</td>";

	    strHTML += "<td bgcolor=#ffffff>"+ AssemblyInfo.XMLDocument.documentElement.childNodes(SelIndex-1).childNodes(j).attributes.getNamedItem("Type").value + "</td>";
	    strHTML += "<td bgcolor=#ffffff><select class=gridtableinputs name='sel"+j+"' onChange=\"populateValues("+j+",'sel','selVal','txtVal')\" >" + selectBox + "</select></td>";
	    strHTML += "<td bgcolor=#ffffff><select class=gridtableinputs name='selVal"+j+"'> </select> <input name='txtVal"+j+"' class=gridtableinputs type=text style='display:none'></td>";

	    strHTML += "</tr>";
	  }
	strHTML += "</table>";
	ParameterList.innerHTML = "<p>&nbsp;Bind Input Parameter to Variable/Content/Value"+strHTML+"</p>";
 }
 else{
	ParameterList.innerHTML   = "";
	OutputParameter.innerHTML = "";
 }

}

function populateValues(index,source,destn,txtBox){
 eval("var oselect3 = document.form1."+source+index+".value");
 eval("document.form1."+destn+index+".options.length=0");
  if(oselect3 == "")
  {
  	eval("document.getElementById('"+txtBox+index+"').style.display = 'none'");
	eval("document.form1."+txtBox+index+".value = ''");
	eval("document.getElementById('"+destn+index+"').style.display = 'block'");
	return;
  }

  if(oselect3 != "Value" && oselect3 != ""){
  	if (oselect3=="Content" && source=="selOP")
		eval("var nodeLength = "+oselect3 +"HndlrDI.XMLDocument.documentElement.childNodes.length");
	else
		eval("var nodeLength = "+oselect3 +"DI.XMLDocument.documentElement.childNodes.length");
	eval("document.getElementById('"+txtBox+index+"').style.display = 'none'");
	eval("document.form1."+txtBox+index+".value = ''");
	eval("document.getElementById('"+destn+index+"').style.display = 'block'");

	for(i=0;i < nodeLength;i++){
		if (oselect3=="Content" && source=="selOP")
			eval("document.form1."+destn+index+".options["+i+"] = new Option("+ oselect3 +"HndlrDI.XMLDocument.documentElement.childNodes("+i+").text,"+  oselect3 +"HndlrDI.XMLDocument.documentElement.childNodes("+i+").text)");
		else
 			eval("document.form1."+destn+index+".options["+i+"] = new Option("+ oselect3 +"DI.XMLDocument.documentElement.childNodes("+i+").text,"+  oselect3 +"DI.XMLDocument.documentElement.childNodes("+i+").text)");
	}
  }
  else{
	eval("document.getElementById('"+txtBox+index+"').style.display = 'block'");
	eval("document.getElementById('"+destn+index+"').style.display = 'none'");
  }
}

function LoadOutputParameters(){
  SelIndex = document.form1.sel_methods.selectedIndex;
  if (SelIndex == "0") return;
	//alert(AssemblyInfo.XMLDocument.documentElement.childNodes(SelIndex+1).attributes.getNamedItem("ReturnType").value);
  //var selectBox1 = "<select name='selOP1' class=gridtableinputs onChange=\"populateValues(1,'selOP','selOPVal','txtOP')\"><option></option><option value='Variable'>Variable</option></select>";
//<option value='Content'>Content</option>
  var selectBox1 = "<select name='selOP1' class=gridtableinputs onChange=\"populateValues(1,'selOP','selOPVal','txtOP')\"><option></option><option value='Variable'>Variable</option><option value='Content'>Content</option></select>";

  OPparamType = AssemblyInfo.XMLDocument.documentElement.childNodes(SelIndex-1).attributes.getNamedItem("ReturnType").value;

  if(OPparamType != ""){
	var strHTML = "<table border=0 cellpadding=3 cellspacing=1  bgcolor=#808080>";
	strHTML += "<tr><td bgcolor=#d4d0c8>&nbsp;</td><td bgcolor=#d4d0c8>&nbsp;</td><td bgcolor=#d4d0c8>O/P Parameter Type</td></tr>";
	strHTML += "<tr><td align=center  bgcolor=#ffffff>"+selectBox1+"</td><td bgcolor=#ffffff><select name='selOPVal1' class=gridtableinputs></select><input type=text name='txtOP1' style='display:none'></td><td bgcolor=#ffffff>"+OPparamType+"</td></tr>";
	strHTML += "</table>";

	OutputParameter.innerHTML = "<p>&nbsp;Bind Method Output to Variable/Content"+strHTML+"</p>";
	OutputMapping.style.display = "block";

	if(!OPflag)
		insert_row("Y");
  }
  else{
	OutputParameter.innerHTML = "";
	OutputMapping.style.display = "none";
  }
}


var new_row_index;

function insert_row(firstRow) {
	var the_table = document.getElementById('my_table');

	//if(firstRow != "Y"){
	if(the_table.rows.length > 1){
		new_row_index = the_table.rows.length;
		the_table.insertRow(new_row_index);
		the_table.rows[new_row_index].insertCell(0);
 		the_table.rows[new_row_index].insertCell(1);
 		the_table.rows[new_row_index].insertCell(2);
 		the_table.rows[new_row_index].insertCell(3);
		the_table.rows[new_row_index].cells[0].innerHTML = 'OR';
		the_table.rows[new_row_index].style.background = "white";
	}
	else{
		OPflag = true;
	}

	new_row_index = the_table.rows.length;
	the_table.insertRow(new_row_index);

	var selectBox =	"<select name='sel_list"+new_row_index+"' class=gridtableinputs onChange=\"populateValues("+new_row_index+",'sel_list','sel_values','txtWfVal')\"><option></option><option value='Variable'>Variable</option><option value='Content'>Content</option><option value='Value'>Value</option></select>";


	the_table.rows[new_row_index].insertCell(0);
	the_table.rows[new_row_index].cells[0].innerHTML = selectBox;
	the_table.rows[new_row_index].style.background = "white";

	the_table.rows[new_row_index].insertCell(1);
	the_table.rows[new_row_index].cells[1].innerHTML = "<select class=gridtableinputs name='sel_values"+new_row_index+"'></select> <input type=text class=gridtableinputs name='txtWfVal"+new_row_index+"' style='display:none'>";

	the_table.rows[new_row_index].insertCell(2);
	the_table.rows[new_row_index].cells[2].innerHTML = "<input class=gridtableinputs type='text' name='WorkflowPath"+new_row_index+"'>";

	the_table.rows[new_row_index].insertCell(3);
	the_table.rows[new_row_index].cells[3].innerHTML = "<div onClick='delete_row("+new_row_index+")' style='cursor:hand'><b> X </b> </div>";
	if(new_row_index==1)
		new_row_index = the_table.rows.length;

}

function delete_row() {
	var the_table = document.getElementById('my_table');

	row_index = event.srcElement.parentElement.parentElement.parentElement.rowIndex;

	the_table.deleteRow(row_index);

	if(row_index != 1)
		the_table.deleteRow(row_index-1);

	if(row_index == 1 && the_table.rows.length > 2)
		the_table.deleteRow(1);

	new_row_index = the_table.rows.length;
}

var XmlWebDetails = "";

function validate(){

	if(document.form1.sel_methods.selectedIndex == 0 ){
		alert("Please choose a Web Method ");
		document.form1.sel_methods.focus();
		return false;
	}
	SelIndex = document.form1.sel_methods.selectedIndex;

	MethodName = AssemblyInfo.XMLDocument.documentElement.childNodes(SelIndex-1).attributes.getNamedItem("Name").value;
	MethodType = AssemblyInfo.XMLDocument.documentElement.childNodes(SelIndex-1).attributes.getNamedItem("ReturnType").value;

	WsdlUrl		= AssemblyInfo.XMLDocument.documentElement.attributes.getNamedItem("WsdlUrl").value;

	LoginNameType	= document.form1.DataType1.value;
	if(LoginNameType != ""){
		if(LoginNameType != "Value")
			LoginName = document.form1.DataList1.value;
		else
			LoginName = document.form1.LoginName1.value;
	}
	else{
		LoginName	= AssemblyInfo.XMLDocument.documentElement.attributes.getNamedItem("LoginName").value;
	}

	PasswordType	= document.form1.DataType2.value;
	if(PasswordType != ""){
		if(PasswordType != "Value")
			Password = document.form1.DataList2.value;
		else
			Password = document.form1.Password2.value;
	}
	else{
		Password	= AssemblyInfo.XMLDocument.documentElement.attributes.getNamedItem("Password").value;
	}

	DomainNameType	= document.form1.DataType3.value;
	if(PasswordType != ""){
		if(DomainNameType != "Value")
			DomainName = document.form1.DataList3.value;
		else
			DomainName = document.form1.DomainName3.value;
	}
	else{
		DomainName	= AssemblyInfo.XMLDocument.documentElement.attributes.getNamedItem("DomainName").value;
	}

	if(MethodType != ""){
		ContentType  = document.form1.selOP1.value;
		if(ContentType !== "")
			ContentValue = document.form1.selOPVal1.options[document.form1.selOPVal1.selectedIndex].text;
		else
			ContentValue = "";
	}
	else{
		ContentType  = "";
		ContentValue = "";
	}

	XmlWebDetails = "<MethodDetails Name='"+ MethodName +"' ServiceID='"+ ServiceID +"'  LoginNameType='"+LoginNameType+"' PasswordType='"+PasswordType+"' DomainNameType='"+DomainNameType+"' LoginName='"+ LoginName+"' Password='"+ Password+"' DomainName='"+DomainName+"' ReturnType='"+ MethodType +"' ContentType='"+ ContentType +"' ContentValue='"+ ContentValue +"' WsdlUrl='"+ WsdlUrl +"' ><Parameters>";

	for(j=0;j < AssemblyInfo.XMLDocument.documentElement.childNodes(SelIndex-1).childNodes.length;j++){
		ParameterName = AssemblyInfo.XMLDocument.documentElement.childNodes(SelIndex-1).childNodes(j).text;
		ParameterType = AssemblyInfo.XMLDocument.documentElement.childNodes(SelIndex-1).childNodes(j).attributes.getNamedItem("Type").value;
		ParameterPosition   = AssemblyInfo.XMLDocument.documentElement.childNodes(SelIndex-1).childNodes(j).attributes.getNamedItem("Position").value;
		PContentType  = eval("document.form1.sel"+j+".value");

		if(PContentType != "Value")
			PContentValue = eval("document.form1.selVal"+j+".options[document.form1.selVal"+j+".selectedIndex].text");
		else
			PContentValue = eval("document.form1.txtVal"+j+".value");

		if (PContentValue.indexOf("'")>=0)
		{
		  PContentValue=PContentValue.replace("'","&apos;");
		}
		if (PContentValue.indexOf("&")>=0)
		{
		  PContentValue=PContentValue.replace("&","&amp;");
		}

		XmlWebDetails += "<Parameter Name='"+ParameterName+"' ParamType='"+ParameterType+"' Position='"+ParameterPosition+"' ContentType='"+PContentType+"' ContentValue='"+PContentValue+"' />";

	}
		XmlWebDetails += "</Parameters><Conditions>";
	//for(j=1;j <= new_row_index;j=j+2){
	var ConditionCount=0;
	var j=1;
	var iLoop=1
	if (new_row_index>1)
	{
	 while(ConditionCount==0){
	  if(typeof(eval("document.form1.sel_list"+j)) != 'undefined')
	  {
		OContentType	= eval("document.form1.sel_list"+j+".value");
		if(eval("document.form1.sel_list"+j+".selectedIndex !== 0")){
				if(OContentType != "Value")
					OContentValue	= eval("document.form1.sel_values"+j+".options[document.form1.sel_values"+j+".selectedIndex].text");
				else
					OContentValue   = eval("document.form1.txtWfVal"+j+".value");

			WfOpPath = eval("document.form1.WorkflowPath"+j+".value");

	 		XmlWebDetails += "<Condition ContentType='"+OContentType+"' ContentValue='"+OContentValue+"' WfOpPath='"+WfOpPath+"' />";
	 	}
	  }
	  else
	 	iLoop=iLoop-2;

	  j=j+2;
	  iLoop=iLoop+2;
	  if (iLoop>new_row_index)
	  	ConditionCount=1;
	 }
	}

	XmlWebDetails += "</Conditions></MethodDetails>";
	submitForm();
}

function submitForm(){
	var submitvalue = "";
	submitvalue = XmlWebDetails;
	window.opener.properties("_hidtempstore",submitvalue);
	window.opener.submitform("?mode=edit&<%#qspropertypagename%>=<%#propertypage%>&<%#qspropertyname%>=<%#propertyname%>&<%#SelectedItemQueryString%>");
	window.close();
}

function submitx(){
	document.form1._mode.value = "ListService";
	document.form1.submit();
}


function LoadValues(){

	var MethodName = MethodDetailsDI.XMLDocument.documentElement.attributes.getNamedItem("Name").value;
	var MReturnType = MethodDetailsDI.XMLDocument.documentElement.attributes.getNamedItem("ReturnType").value;

	var OutputContentType=MethodDetailsDI.XMLDocument.documentElement.attributes.getNamedItem("ContentType").value;
	var OutputContentValue=MethodDetailsDI.XMLDocument.documentElement.attributes.getNamedItem("ContentValue").value;

	for(i=0;i < document.form1.sel_methods.options.length;i++){
		if(document.form1.sel_methods.options[i].text == MethodName){
				MethodIndex = i;
				break;
		}
	}
	form1.sel_methods.selectedIndex = MethodIndex;

	LoadParameters(document.form1.sel_methods.selectedIndex);
	LoadOutputParameters();

	// ------------------- Populating the values for Parameters --------------------- //

	for(j=0;j < MethodDetailsDI.XMLDocument.documentElement.childNodes(0).childNodes.length;j++){
		var ContentType = MethodDetailsDI.XMLDocument.documentElement.childNodes(0).childNodes(j).attributes.getNamedItem("ContentType").value;

		var selLength = eval("document.form1.sel"+j+".options.length");

		for(i=0;i < selLength;i++){
			if(eval("document.form1.sel"+j+".options[i].text == ContentType")){
				TypeIndex = i;
				break;
			}
		}
		eval("document.form1.sel"+j+".selectedIndex = TypeIndex");
		eval("populateValues("+j+",'sel','selVal','txtVal')");

		var ContentValue = MethodDetailsDI.XMLDocument.documentElement.childNodes(0).childNodes(j).attributes.getNamedItem("ContentValue").value;

		if(ContentType == "Value"){
			eval("document.form1.txtVal"+j+".value = ContentValue");
		}
		else{
			valueLen = eval("document.form1.selVal"+j+".options.length");

			for(var i=0; i < valueLen; i++) {
			    eval("selValue = document.form1.selVal"+j+".options[i].value");

				if(selValue == ContentValue){
					eval("document.form1.selVal"+j+".options[i].selected = true");
					break;
				}
			}
		}

	}

	 // ------------------- Populating the values for Output Parameters --------------------- //
if(MReturnType != ""){
	var OPContentType  = MethodDetailsDI.XMLDocument.documentElement.attributes.getNamedItem("ContentType").value;

	for(i=0;i < document.form1.selOP1.options.length;i++){
		if(document.form1.selOP1.options[i].text == OPContentType){
				TypeIndex = i;
				break;
		}
	}

		document.form1.selOP1.selectedIndex = TypeIndex;
		populateValues(1,'selOP','selOPVal','txtOP');

//		if(ContentType == "Value"){
		if(OutputContentType == "Value"){
			eval("document.form1.txtOP1.value = ContentValue");
		}
		else{
			valueLen = document.form1.selOPVal1.options.length;

			for(var i=0; i < valueLen; i++) {
			    selValue = document.form1.selOPVal1.options[i].value;
				if(selValue == OutputContentValue){
					eval("document.form1.selOPVal1.options[i].selected = true");
					break;
				}
			}
		}

}
	// ------------------- Populating the values for Condition --------------------- //
	id = -1;

	for(j=0;j < MethodDetailsDI.XMLDocument.documentElement.childNodes(1).childNodes.length;j++){

		if(j > 0)
			insert_row('N');

		id = id + 2;
		var ContentType = MethodDetailsDI.XMLDocument.documentElement.childNodes(1).childNodes(j).attributes.getNamedItem("ContentType").value;
		var selLength = eval("document.form1.sel_list"+id+".options.length");

		for(i=0;i < selLength;i++){
			if(eval("document.form1.sel_list"+id+".options[i].text == ContentType")){
				TypeIndex = i;
				break;
			}
		}
		var WorkFlowPath = MethodDetailsDI.XMLDocument.documentElement.childNodes(1).childNodes(j).attributes.getNamedItem("WfOpPath").value;

		eval("document.form1.sel_list"+id+".selectedIndex = TypeIndex");
		eval("document.form1.WorkflowPath"+id+".value = WorkFlowPath");
		eval("populateValues("+id+",'sel_list','sel_values','txtWfVal')");

		var ContentValue = MethodDetailsDI.XMLDocument.documentElement.childNodes(1).childNodes(j).attributes.getNamedItem("ContentValue").value;

		if(ContentType == "Value"){
			eval("document.form1.txtWfVal"+id+".value = ContentValue");
		}
		else{
			valueLen = eval("document.form1.sel_values"+id+".options.length");
			for(var i=0; i < valueLen; i++) {
			    eval("selValue = document.form1.sel_values"+id+".options[i].value");
				if(selValue == ContentValue){
					eval("document.form1.sel_values"+id+".options[i].selected = true");
					break;
				}
			}
		}
	}

}
</script>
</head>
	<body onLoad="LoadMethods();LoadLoginInfo();LoadValues()">

	<xml id="AssemblyInfo">
		<%#AssemblyInfoXML%>
	</xml>

	<xml id="VariableDI">
		<%#VariableXML%>
	</xml>

	<xml id="ContentDI">
		 <%#ContentXML%>
	</xml>

	<xml id="ContentHndlrDI">
		 <%#ContentHandlerXML%>
	</xml>

	<xml id="MethodDetailsDI">
		 <%#WebMethodDetails%>
	</xml>

<form name="form1" method="post">
<p align=right><input type=button class="buttons" value="Web Service Listing Page" onclick="submitx()" name="button1"> </p>
	<p align='center'>	Web Methods of the Web service -	<br><br>
	<select name="sel_methods" class=gridtableinputs onChange="LoadParameters(document.form1.sel_methods.selectedIndex);LoadOutputParameters()">
		<option>Choose a Method</option>
		<%#WebMethodList%>
	</select>
			<p valign=top>
<table cellspacing=2 cellpadding=2 >
<tr>
<td height=30>Login Name<td>
<select id="DataType1" name="DataType1" class=gridtableinputs onChange="populateValues('1','DataType','DataList','LoginName')">
<option value="">Default</option><option value="Variable">Variable</option>
<option value="Content">Content</option><option value="Value">Value</option>
</select>
<td>
<select id="DataList1" name="DataList1" class=gridtableinputs>
</select>
<input type="text" name="LoginName1" size="20" style="display:none"></td>
</tr>
<tr>
<td height=30>Password<td>
<select id="DataType2" name="DataType2" class=gridtableinputs onChange="populateValues('2','DataType','DataList','Password')">
<option value="">Default</option><option value="Variable">Variable</option>
<option value="Content">Content</option><option value="Value">Value</option>
</select>
<td><select id="DataList2" name="DataList2" class=gridtableinputs>
</select>
<input type="text" name="Password2" size="20" style="display:none"></td>
</tr>
<tr>
<td height=30>Domain Name<td>
<select id="DataType3" name="DataType3" class=gridtableinputs onChange="populateValues('3','DataType','DataList','DomainName')">
<option value="">Default</option><option value="Variable">Variable</option>
<option value="Content">Content</option><option value="Value">Value</option>
</select>
<td><select id="DataList3" name="DataList3" class=gridtableinputs>
</select>
 <input type="text" name="DomainName3" size="20" style="display:none"></td>
</tr>
</table>

<div id="ParameterList"></div>

<div id="OutputParameter"></div>
		<p>&nbsp;</p>
<div id="OutputMapping" style="display:none">

	<table ID="Table1" >
	<tr><td> Form conditions to route to different workflow paths based on the value of method output</td></tr>
		<tr><td>
			<table id="my_table" border=0 cellpadding=3 cellspacing=1 width="300" bgcolor=#808080>
			<tr bgcolor=white><td bgcolor=#d4d0c8>If Output =</td><td bgcolor=#d4d0c8>&nbsp;</td><td bgcolor=#d4d0c8>Workflow O/P Path</td><td bgcolor=#d4d0c8>Delete</td></tr>
			</table>
		</td>
		<tr ><td align=right>
			<input type=button class="buttons" value="Add Condition" onclick="insert_row('N')" >
		</td>
		</tr>
	</table>
</div>

</p>

<p align=right>
		<input type=button value="Update" class="buttons" onClick="validate()">&nbsp;&nbsp;	<input type=button value="Cancel"  class="buttons"  onClick="window.close()" id=button1 name=button1>
		<input type="hidden" name="_mode" >
</p>
		</form>

	</body>
</html>